<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AddHouseResourceToOpenShopSiteLocationsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('open_shop_site_locations', function (Blueprint $table) {
            $table->unsignedTinyInteger('grade')->default(0)->comment('房源等级');
            $table->unsignedInteger('score')->default(0)->comment('评分');
            $table->unsignedInteger('nearbyShopCode')->default(0)->comment('附近门店的Code');
            $table->decimal('nearbyRange', 7,2)->default(-1)->comment('附近门店的距离-千米');
            $table->unsignedInteger('shopModelType')->default(0)->comment('门店模型类型');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('open_shop_site_locations', function (Blueprint $table) {
            $table->dropColumn(['grade', 'score', 'nearbyShopId', 'nearbyRange', 'shopModelType']);
        });
    }
}
